<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>class RubyXL::OOXMLContainerObject - rubyXL 3.4.35</title>


  <meta name="keywords" content="ruby,class,RubyXL::OOXMLContainerObject">


    <meta name="description" content="class RubyXL::OOXMLContainerObject: Parent class for OOXML container objects (for example, &lt;tt&gt;&amp;lt;fonts&amp;gt;&amp;lt;font&amp;gt;. font&amp;gt;&amp;lt;font&amp;gt;.">





<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
</script>

<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">



<body id="top" role="document" class="class">
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
  <span aria-hidden="true">&#9776;</span>
</div>


<nav id="navigation" role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  

  
<div id="parent-class-section" class="nav-section">
  <h3>Ancestors</h3>
  <ul><li>Array</li></ul>
</div>


  
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">


    <li><a class="include" href="OOXMLObjectInstanceMethods.html">RubyXL::OOXMLObjectInstanceMethods</a></li>


  </ul>
</div>


  

  
  <div class="nav-section">
    <h3>Class Methods</h3>
    <ul class="link-list" role="directory">

      <li ><a href="#method-c-define_count_attribute">define_count_attribute</a></li>

      <li class="calls-super" ><a href="#method-c-new">new</a></li>

    </ul>
  </div>



  <div class="nav-section">
    <h3>Instance Methods</h3>
    <ul class="link-list" role="directory">

      <li ><a href="#method-i-before_write_xml">before_write_xml</a></li>

      <li class="calls-super" ><a href="#method-i-get_node_object">get_node_object</a></li>

      <li ><a href="#method-i-init_child_nodes">init_child_nodes</a></li>

      <li class="calls-super" ><a href="#method-i-inspect">inspect</a></li>

    </ul>
  </div>



  <footer id="validator-badges" role="contentinfo">
  <p><a href="https://validator.w3.org/check/referer">Validate</a></p>
  <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.15.1.</p>
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>
</footer>

</nav>

<main role="main" aria-labelledby="class-RubyXL::OOXMLContainerObject">
  
  
    <ol role="navigation" aria-label="Breadcrumb navigation" class="breadcrumb">
      
      <li>
        
        <a href="../RubyXL.html">RubyXL</a><span>::</span>
        
      </li>
      
      <li>
        
        <span>OOXMLContainerObject</span>
        
      </li>
      
    </ol>
  

  <h1 id="class-RubyXL::OOXMLContainerObject" class="anchor-link class">
    class RubyXL::OOXMLContainerObject
  </h1>

  <section class="description">
    
<p>Parent class for OOXML container objects (for example, <code>&amp;lt;fonts&amp;gt;&amp;lt;font&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;font&amp;gt;...&amp;lt;/font&amp;gt;&amp;lt;/fonts&amp;gt;</code> that obscures the top-level container, allowing direct access to the contents as <code>Array</code>.</p>

  </section>


  <section id="5Buntitled-5D" class="documentation-section anchor-link">









     <section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
       <header>
         <h3>Public Class Methods</h3>
       </header>


      <div id="method-c-new" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-c-new" title="Link to this method">
                <span class="method-name">new</span>
                <span class="method-args">(params = {})</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/ooxml_object.rb, line 382</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">params</span> = {})
  <span class="ruby-identifier">array_content</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:_</span>)
  <span class="ruby-keyword">super</span>
  <span class="ruby-identifier">array_content</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword">self</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">v</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">array_content</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


            <div class="method-calls-super">
              Calls superclass method
              <a href="OOXMLObjectInstanceMethods.html#method-c-new"><code>RubyXL::OOXMLObjectInstanceMethods::new</code></a>
            </div>

        </div>





      </div>


    </section>

     <section id="protected-class-5Buntitled-5D-method-details" class="method-section anchor-link">
       <header>
         <h3>Protected Class Methods</h3>
       </header>


      <div id="method-c-define_count_attribute" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-c-define_count_attribute" title="Link to this method">
                <span class="method-name">define_count_attribute</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="define_count_attribute-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/ooxml_object.rb, line 414</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">define_count_attribute</span>
  <span class="ruby-comment"># Count will be inherited from Array. so no need to define it explicitly.</span>
  <span class="ruby-identifier">define_attribute</span>(<span class="ruby-value">:count</span>, <span class="ruby-value">:uint</span>, <span class="ruby-value">:required</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">:computed</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>)
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


    </section>

     <section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
       <header>
         <h3>Public Instance Methods</h3>
       </header>


      <div id="method-i-before_write_xml" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-before_write_xml" title="Link to this method">
                <span class="method-name">before_write_xml</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="before_write_xml-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/ooxml_object.rb, line 403</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">before_write_xml</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-inspect" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-inspect" title="Link to this method">
                <span class="method-name">inspect</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="inspect-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/ooxml_object.rb, line 407</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect</span>
  <span class="ruby-identifier">vars</span> = [ <span class="ruby-keyword">super</span> ]
  <span class="ruby-identifier">vars</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">vars</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{v}=#{instance_variable_get(v).inspect}&quot;</span> }
  <span class="ruby-node">&quot;&lt;#{self.class}: #{super} #{vars.join(&quot;, &quot;)}&gt;&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


            <div class="method-calls-super">
              Calls superclass method
              
            </div>

        </div>





      </div>


    </section>

     <section id="protected-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
       <header>
         <h3>Protected Instance Methods</h3>
       </header>


      <div id="method-i-get_node_object" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-get_node_object" title="Link to this method">
                <span class="method-name">get_node_object</span>
                <span class="method-args">(child_node_params)</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="get_node_object-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/ooxml_object.rb, line 388</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_node_object</span>(<span class="ruby-identifier">child_node_params</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">child_node_params</span>[<span class="ruby-value">:is_array</span>] <span class="ruby-keyword">then</span> <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">else</span> <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


            <div class="method-calls-super">
              Calls superclass method
              <a href="OOXMLObjectInstanceMethods.html#method-i-get_node_object"><code>RubyXL::OOXMLObjectInstanceMethods#get_node_object</code></a>
            </div>

        </div>





      </div>


      <div id="method-i-init_child_nodes" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-init_child_nodes" title="Link to this method">
                <span class="method-name">init_child_nodes</span>
                <span class="method-args">(params)</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="init_child_nodes-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/ooxml_object.rb, line 395</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">init_child_nodes</span>(<span class="ruby-identifier">params</span>)
  <span class="ruby-identifier">obtain_class_variable</span>(<span class="ruby-value">:@@ooxml_child_nodes</span>).<span class="ruby-identifier">each_value</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>[<span class="ruby-value">:is_array</span>] <span class="ruby-comment"># Only one collection node allowed per OOXMLContainerObject, and it is contained in itself.</span>
    <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{v[:accessor]}&quot;</span>, <span class="ruby-identifier">params</span>[<span class="ruby-identifier">v</span>[<span class="ruby-value">:accessor</span>]])
  }
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


    </section>

  </section>

</main>
</body>

